import 'package:flutter_deer/account/models/flowing_water_entity.dart';
import 'package:flutter_deer/generated/json/base/json_convert_content.dart';

FlowingWaterEntity $FlowingWaterEntityFromJson(Map<String, dynamic> json) {
  final FlowingWaterEntity flowingWaterEntity = FlowingWaterEntity();
  final String? date = jsonConvert.convert<String>(json['date']);
  if (date != null) {
    flowingWaterEntity.date = date;
  }
  final String? month = jsonConvert.convert<String>(json['month']);
  if (month != null) {
    flowingWaterEntity.month = month;
  }
  final List<FlowingWaterItemEntity>? list = jsonConvert.convert<List<FlowingWaterItemEntity>>(json['list']);
  if (list != null) {
    flowingWaterEntity.list = list;
  }
  return flowingWaterEntity;
}

Map<String, dynamic> $FlowingWaterEntityToJson(FlowingWaterEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['date'] = entity.date;
  data['month'] = entity.month;
  data['list'] = entity.list;
  return data;
}

FlowingWaterItemEntity $FlowingWaterItemEntityFromJson(Map<String, dynamic> json) {
  final FlowingWaterItemEntity flowingWaterItemEntity = FlowingWaterItemEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    flowingWaterItemEntity.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    flowingWaterItemEntity.userId = userId;
  }
  final double? score = jsonConvert.convert<double>(json['score']);
  if (score != null) {
    flowingWaterItemEntity.score = score;
  }
  final double? beforeScore = jsonConvert.convert<double>(json['beforeScore']);
  if (beforeScore != null) {
    flowingWaterItemEntity.beforeScore = beforeScore;
  }
  final double? afterScore = jsonConvert.convert<double>(json['afterScore']);
  if (afterScore != null) {
    flowingWaterItemEntity.afterScore = afterScore;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    flowingWaterItemEntity.type = type;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    flowingWaterItemEntity.remark = remark;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    flowingWaterItemEntity.createTime = createTime;
  }
  final String? time = jsonConvert.convert<String>(json['time']);
  if (time != null) {
    flowingWaterItemEntity.time = time;
  }
  final String? waterContentType = jsonConvert.convert<String>(json['waterContentType']);
  if (waterContentType != null) {
    flowingWaterItemEntity.waterContentType = waterContentType;
  }
  return flowingWaterItemEntity;
}

Map<String, dynamic> $FlowingWaterItemEntityToJson(FlowingWaterItemEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['userId'] = entity.userId;
  data['score'] = entity.score;
  data['beforeScore'] = entity.beforeScore;
  data['afterScore'] = entity.afterScore;
  data['type'] = entity.type;
  data['remark'] = entity.remark;
  data['createTime'] = entity.createTime;
  data['time'] = entity.time;
  data['waterContentType'] = entity.waterContentType;
  return data;
}